﻿using NHibernate;
using NHibernate.Cfg;

namespace OpenGado.DATA
{
   public  class SessionHandler
    {
        static ISessionFactory _factory = null;

        public static ISessionFactory CreateFactory()
        {
            if (_factory == null)
            {
                _factory = new Configuration().Configure().BuildSessionFactory();

            }
            return _factory;
        }

        public static void CloseFactory()
        {
            _factory.Close();
        }
    }
}
